<div class="wrapper">
  <app-nav-bar></app-nav-bar>
    <!-- 左侧菜单 -->
    <app-left-menu></app-left-menu>

    <!-- 内容区域 -->
    <div class="content-wrapper">
        <!-- 顶部导航栏 -->

        <!-- Content Header (Page header) -->
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0">竞标估价</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="/dashboard">返回</a></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <!-- Main content -->
        <div class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h3 class="card-title">估价详情</h3>
                            </div>
                            <div class="card-body">
                                <!-- 输入框和按钮 -->
                                <form (ngSubmit)="startEvaluation()">
                                    <div class="form-group">
                                        <label for="securityName">证券代码</label>
                                        <input type="text" class="form-control" id="securityName" [(ngModel)]="securityName" name="securityName" placeholder="请输入证券代码">
                                    </div>
                                    <div class="form-group">
                                        <label for="startDate">起始日期</label>
                                        <input type="date" class="form-control" id="startDate" [(ngModel)]="startDate" name="startDate">
                                    </div>
                                    <div class="form-group">
                                        <label for="endDate">结束日期</label>
                                        <input type="date" class="form-control" id="endDate" [(ngModel)]="endDate" name="endDate">
                                    </div>
                                    <button type="submit" class="btn btn-primary">开始估值</button>
                                </form>

                                <!-- 显示柱状图 -->
                                <div *ngIf="dailyEvaluation.length > 0" class="mt-3">
                                    <h5>每日估值柱状图：</h5>
                                    <canvas baseChart
                                        [data]="lineChartData"
                                        [options]="lineChartOptions"
                                        chartType="line">
                                    </canvas>
                                </div>

                                <!-- 显示时间段的峰值、谷值和平均值 -->
                                <div *ngIf="summaryResult !== null" class="mt-3">
                                    <h5>时间段总结：</h5>
                                    <p>峰值: {{ summaryResult.peak }}</p>
                                    <p>谷值: {{ summaryResult.valley }}</p>
                                    <p>平均值: {{ summaryResult.average }}</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
